package com.phevos.knowledge.model;

import java.io.Serializable;
import java.math.BigDecimal;

import javax.persistence.Column;
import javax.persistence.Embeddable;

@Embeddable
public class CategoriesId extends BaseObject implements Serializable {
    /**
     * 
     */
    private static final long serialVersionUID = 277319335728957360L;
    private BigDecimal catId;
    private BigDecimal catParent;
    private Long catLevel;
    private String catName;
    private String catDescription;


    @Column(name="cat_id", nullable=false, precision=38, scale=0)
    public BigDecimal getCatId() {
        return this.catId;
    }
    
    public void setCatId(BigDecimal catId) {
        this.catId = catId;
    }

    @Column(name="cat_parent", nullable=false, precision=38, scale=0)
    public BigDecimal getCatParent() {
        return this.catParent;
    }
    
    public void setCatParent(BigDecimal catParent) {
        this.catParent = catParent;
    }

    @Column(name="cat_level", nullable=false)
    public Long getCatLevel() {
        return this.catLevel;
    }
    
    public void setCatLevel(Long catLevel) {
        this.catLevel = catLevel;
    }

    @Column(name="cat_name", nullable=false, length=450)
    public String getCatName() {
        return this.catName;
    }
    
    public void setCatName(String catName) {
        this.catName = catName;
    }

    @Column(name="cat_description", nullable=false, length=765)
    public String getCatDescription() {
        return this.catDescription;
    }
    
    public void setCatDescription(String catDescription) {
        this.catDescription = catDescription;
    }

    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;

        CategoriesId pojo = (CategoriesId) o;

        if (catId != null ? !catId.equals(pojo.catId) : pojo.catId != null) return false;
        if (catParent != null ? !catParent.equals(pojo.catParent) : pojo.catParent != null) return false;
        if (catLevel != null ? !catLevel.equals(pojo.catLevel) : pojo.catLevel != null) return false;
        if (catName != null ? !catName.equals(pojo.catName) : pojo.catName != null) return false;
        if (catDescription != null ? !catDescription.equals(pojo.catDescription) : pojo.catDescription != null) return false;

        return true;
    }

    public int hashCode() {
        int result = 0;
        result = 31 * result + (catId != null ? catId.hashCode() : 0);
        result = (catParent != null ? catParent.hashCode() : 0);
        result = 31 * result + (catLevel != null ? catLevel.hashCode() : 0);
        result = 31 * result + (catName != null ? catName.hashCode() : 0);
        result = 31 * result + (catDescription != null ? catDescription.hashCode() : 0);

        return result;
    }

    public String toString() {
        StringBuffer sb = new StringBuffer(getClass().getSimpleName());

        sb.append(" [");
        sb.append("catId").append("='").append(getCatId()).append("', ");
        sb.append("catParent").append("='").append(getCatParent()).append("', ");
        sb.append("catLevel").append("='").append(getCatLevel()).append("', ");
        sb.append("catName").append("='").append(getCatName()).append("', ");
        sb.append("catDescription").append("='").append(getCatDescription()).append("'");
        sb.append("]");
      
        return sb.toString();
    }

}
